<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="jquery/jquery.min.js"></script>
    <script>

      $(function () {
          $("#btn1").click(function () {
              $.post("/employees",{name:"代进",age:22},function (data) {
                  console.log(data);
              })
          })

          $("#btn4").click(function () {
              $.get("/employees",{id:1},function (data) {
                  console.log(data);
              })
          })

          $("#btn3").click(function () {

              $.ajax({
                  url:"/employees",
                  type:"PUT",
                  data:{id:1,name:"呆呆",age:21},
                  success:function (data) {
                      console.log(data);

                  }
              })
          })
          $("#btn2").click(function () {

              $.ajax({
                  url:"/employees/1",
                  type:"DELETE",
                  success:function (data) {
                      console.log(data);

                  }
              })
          })
    })



    </script>

</head>
<body>

<input type="button" id="btn1" value="添加"></button>
<input type="button" id="btn2" value="删除"></button>
<input type="button" id="btn3" value="更新"></button>
<input type="button" id="btn4" value="查询"></button>
</body>
</html>